namespace Webinator.Interfaces
{
    using System.Diagnostics.CodeAnalysis;
    using Webinator.Impls;

    [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")]
    public interface IJavascript
    {
        void BeginListeningForPageSubmit();

        bool PageIsSubmitting();

        void WaitForPageToFinishSubmitting(int timeoutInMilliseconds = 10000);

        void StopListeningForPageSubmit();

        void InjectJquery();

        bool NetworkActive();

        void RunJavaScript(string js);

        /// <summary>
        /// Displays a message in the browser.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="interval">How long to display the message in milliseconds.</param>
        void DisplayMessageInBrowser(string message, int interval = 2500);

        string GetJavascriptAddCookie(JavascriptCookie cookie);

        string GetJavascriptDeleteCookie(string name);

        string GetJavascriptGetCookie(string name);

        string GetJavascriptSetCookie(JavascriptCookie cookie);
    }
}